import React, { PureComponent, Fragment } from 'react';
import { connect } from 'dva';
import { Card, Row, Col, Steps, Avatar, Tag, Divider, Spin, Input, Skeleton } from 'antd';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import styles from './style.less';

const { Meta } = Card;
const { Step } = Steps;

@connect(({ loading, user, project }) => ({

}))
class Index extends PureComponent {
  state = {
    loading: true,
  };

  componentDidMount() {
    const { dispatch } = this.props;

  }

  getCurrentStep() {
    const { location } = this.props;
    const { pathname } = location;
    const pathList = pathname.split('/');
    switch (pathList[pathList.length - 1]) {
      case 'messageSetting':
        return 0;
      case 'paperSetting':
        return 1;
      case 'result':
        return 2;
      default:
        return 0;
    }
  }

  render() {
    const { loading } = this.state;
    const { match, location, children } = this.props;
    const tabList = [
      {
        key: 'message',
        tab: (
          <span>
            竞赛信息设置 <span style={{ fontSize: 14 }}>(0 )</span>
          </span>
        ),
      },
      {
        key: 'paper',
        tab: (
          <span>
            试卷编写 <span style={{ fontSize: 14 }}>(0)</span>
          </span>
        ),
      },
      {
        key: 'put',
        tab: (
          <span>
            答题设置 <span style={{ fontSize: 14 }}>(0)</span>
          </span>
        ),
      },
      {
        key: 'end',
        tab: (
          <span>
            大赛模板 <span style={{ fontSize: 14 }}>(0)</span>
          </span>
        ),
      },
    ];

    return (
      <PageHeaderWrapper
        title="搜索列表"
        // content={mainSearch}
        // tabList={tabList}
        // tabActiveKey={location.pathname.replace(`${match.path}/`, '')}
        // onTabChange={this.handleTabChange}
      >
        {children}
        {/* <Switch>
          {routes.map(item => (
            <Route key={item.key} path={item.path} component={item.component} exact={item.exact} />
          ))}
        </Switch> */}
      </PageHeaderWrapper>
    );
  }
}

export default Index;
